package cn.edu.nwsuaf.teachercenter.service;

import java.io.InputStream;
import java.io.Serializable;
import java.util.List;

public interface BaseService<T> {
	abstract int countData(String hql, String[] param);
	abstract List<T> findDataByHql(String hql, String[] param, int currentpage, int rows);
	abstract List<T> findAll(Class<T> c);
	abstract List<T> findAll(String hql, String[] param);
	
	abstract T getById(Class<T> c, Serializable id);
	abstract T loadById(Class<T> c, Serializable id);
	
	abstract void saveData(T t);
	abstract void saveDataList(List<T> list);
	
	abstract void deleteData(T t);
	abstract void deleteDataList(List<T> list);
	
	abstract void updateData(T t);
	abstract void updateDataList(List<T> list);
	
	abstract boolean saveFile(String path, InputStream is);
	abstract List<Byte[]> readFile(String path);
}
